Processing data using vector fields

ABSTRACT

Disclosed is a method including receiving a rule having at least one rule case for producing an output value based on one or more input values, generating a transform for receiving data from an input dataset and transforming the data based on the rule including producing a first series of values for at least one output variable in an output dataset, at least one value in the first series of values including a second series of values, and providing an output field corresponding to the at least one output variable in the output dataset for storing the second series of values.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation application and claims priority under35 U.S.C. §120 to U.S. patent application Ser. No. 12/696,667 filed onJan. 29, 2010, to be issued as U.S. Pat. No. 8,478,706 on Jul. 2, 2013,which claims benefit under U.S.C. §119(e) to U.S. ProvisionalApplication 61/148,888, filed on Jan. 30, 2009. The above applicationsare incorporated herein by reference.

BACKGROUND

This description relates to processing data using vector fields.

Some computing systems provide an interface for specifying rules thatare used for automated decision making in various data processingapplications. Decisions associated with processing data representingcredit card transactions or airline frequent flyer programs, forexample, may be governed by a given set of rules. In some cases, theserules are described in human-readable form. The computing system mayprovide an interface for a user to define or edit these rules, and thenincorporate the rules into a data processing system.

SUMMARY

In one aspect, in general, a method includes receiving a rule having atleast one rule case for producing an output value based on one or moreinput values, generating a transform for receiving data from an inputdataset and transforming the data based on the rule including producinga first series of values for at least one output variable in an outputdataset, at least one value in the first series of values including asecond series of values, and providing an output field corresponding tothe at least one output variable in the output dataset for storing thesecond series of values.

Aspects can include one or more of the following features.

The transform can be included in a component of a graph-basedapplication represented by a graph, with vertices in the graphrepresenting components, and directed links between vertices in thegraph represent flows of data between components.

A first graph component including the transform can provide a flow ofdata to the transform from the input dataset.

The first graph component can be an executable computation component,and the graph can include a second graph component that is a datastorage component representing the input dataset.

Producing a first series of values for at least one variable in anoutput dataset can include producing rows for an output table, each rowdefining a record having values for a set of variables including theoutput variable.

Providing an output field for storing the second series of values caninclude providing an array for storing a predetermined number of thesecond series of values, the predetermined number being a default numberthat is modifiable to a user-specified number. The output field caninclude a cell in a table.

Receiving the rule can include receiving at least a row of a rule table,the row corresponding to a rule case, and having an output including oneor more or a combination of the input values, a predetermined value, ora value computed from one or more of the input values.

The rule case can include one or more of: having an input value equal toa threshold, having an input value above a threshold, having an inputvalue below a threshold, having an input value belonging to a set ofvalues, having an input value matching a pattern of values, having arelationship to another input value, having a relationship to an outputvalue of another set of rules, or having a relationship to a value in amemory.

The input dataset can include records having values for scalar variablesand vector variables. At least one of the records can include an arrayfor storing a predetermined number of records, the predetermined numberbeing a default number that is modifiable to a user-specified number. Atleast one of the records includes an internal reference table to definekey relationships to sub-records in the at least one of the records.

The method can also include, in response to a rule, producing the secondseries of values for the output variable in the output dataset based onthe key relationships in the internal reference table.

The method can also include, in response to a rule case in a rule,triggering the rule case to produce a value for the output variable inthe output dataset. Triggering a rule case can include triggering therule based on a scalar value in the input dataset satisfying the atleast one rule case in the rule.

Triggering a rule case can include triggering the rule based on eachvalue in a vector in the input dataset satisfying the at least one rulecase in the rule.

Triggering a rule case can include triggering the rule case based on anoutput of an aggregate function applied to a vector in the input datasetsatisfying the at least one rule case in the rule.

Generating the transform can include converting each of a plurality ofrule cases in the rule to a logical expression to form a plurality oflogical expressions, and compiling the plurality of logical expressionsinto computer-executable code.

Compiling the plurality of logical expressions can include one or moreof combining expressions, optimizing individual expressions, andoptimizing groups of expressions.

In another aspect, in general, a computer-readable medium storing acomputer program for updating a component in a graph-based computationhaving data processing components connected by linking elementsrepresenting data flows includes instructions for causing a computer toreceive a rule having at least one rule case for producing an outputvalue based on one or more input values, generate a transform forreceiving data from an input dataset and transforming the data based onthe rule including producing a first series of values for at least oneoutput variable in an output dataset, at least one value in the firstseries of values including a second series of values, and provide anoutput field corresponding to the at least one output variable in theoutput dataset for storing the second series of values.

In another aspect, a system includes a means for receiving a rule havingat least one rule case for producing an output value based on one ormore input values, a processor configured to generate a transform forreceiving data from an input dataset and transforming the data based onthe rule including producing a first series of values for at least oneoutput variable in an output dataset, at least one value in the firstseries of values including a second series of values, and a means forproviding an output field corresponding to the at least one outputvariable in the output dataset for storing the second series of values.

Other features and advantages of the invention will become apparent fromthe following description, and from the claims.

DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic depicting an example transform.

FIG. 2 is an example transform generator.

FIGS. 3 and 4 are example rule sets.

FIG. 5 is an example Fire-Many rule set.

FIGS. 6, 7, and 8 are example output, rule, and result tabs.

FIG. 9 is a schematic depicting computation of scalars and vectors.

FIGS. 10A and 10B show an example input record having record vectors.

DESCRIPTION

A business rule can be expressed as a set of criteria that can be usedto, for example, convert data from one format to another, makedeterminations about data, or generate new data based on a set of inputdata. For example, in FIG. 1, a record 102 in a flight reservationsystem indicates a passenger's name 104, miles 106 the passenger hasflown in the current year, class 108 of the passenger's ticket, and thepassenger's current row 110 in an airline. A business rule may indicatethat such the passenger should be classified within boarding group “1,”e.g., group 118. A business rule is generally easy for a human tounderstand, e.g., “first class passengers are in group 1,” but may needto be translated into language that a computer can understand before itcan be used to manipulate data. Accordingly, to implement the businessrule, a transform 112 is generated to receive an input record, e.g.,record 102, from one or more data sources, e.g., input dataset 100, andproduce an output record, e.g., record 114, indicating the passenger'sname 104 and group 118, into an output dataset 120. Input and outputdatasets are also referred to as data streams.

To simplify creation of a transform 112 for non-technical users,typically an editor tool (not shown) is provided to input a set ofbusiness rules, referred to as a rule set, or a set of rules, in aformat familiar to the users. The set of rules, in turn, instructs acomputer system to generate the transform 112 which further instructsthe computer system what to do with input dataset 100, and what toproduce into output dataset 120. A rule or rule set that corresponds toa single transform can include one or more rule cases that computedifferent values for a rule set's output variables depending on an inputrecord. When a rule case in a rule is triggered, the rule, and moreparticularly, the rule case, is regarded to be fired. For example, onlyone rule case in a rule can be filed. In some examples, more than onerule case in a rule can be filed. In some examples, when a rule case isfired, the entire rule can be regarded as being fired. In someimplementations, a rule case or rule is triggered or fired if, forexample, an input scalar or vector value in an input dataset satisfiesone or more conditions in the rule case or rule. A rule set can alsoinclude other rules sets. The other rule sets can produce values foradditional or alternative output variables. For example, a rule set candirectly contain or indirectly refer to other rule sets, referred to as“included” rule sets.

An example transform generation system is shown in FIG. 2. A generator150 receives as input a rule set 152 from an editor 154 and generates atransform 156. The generated transform 156 may be provided to agraph-based computation system 158 as a component to be used in a graphor as an entire graph itself, depending on the system's architecture andthe purpose of the transform and the business rules. The graph-basedcomputation system 158 can provide a computation environment that allowsa programmer to build a graph-based application by using components asbuilding blocks. A graph-based application is often represented by adirected graph, with vertices in the graph representing components(either data storage components or executable computation components),and the directed links or “edges” in the graph representing flows ofdata between components. A dataflow graph (also called simply a “graph”)is a modular entity. Each graph can be made up of one or more othergraphs, and a particular graph can be a component in a larger graph.

The generator 150 can be, for example, a compiler, a custom-builtprogram, or a graph-based computation configured using standard tools toreceive the rule set 152 and output the transform 156. Any technique forproducing, and subsequently updating the transform 156 known to thoseskilled in the art can be used to generate transform 156. For example, atechnique for producing transforms is described in U.S. patentapplication Ser. No. 11/733,434, entitled “Editing and CompilingBusiness Rules,” filed Apr. 10, 2007, and incorporated herein byreference in its entirety.

In some examples, the transform 156 generates only one value for anoutput variable corresponding to an input record 102. In such a scheme,a rule set can fire at most only once. Accordingly, some problems, e.g.,data quality problems, may not be easily implemented using the transform156. In some examples, output variables in an output dataset 120 caninclude “Write-Once Outputs.” In general, “Write-Once Outputs” areoutput variables that are typically written to once for a given inputrecord, and store only one value for the given input record. Rule setsthat produce such variables are called “Fire-Once” rules.

In some examples, a “Fire-Many” rule can produce “accumulator” outputvariables, e.g., variables that are capable of receiving a series ofvalues for a given input record, instead of only one value. A“Fire-Many” rule would fire for every rule case within a rule set thatis triggered for that input record, and not just, for example, the firstrule case that is triggered.

In some examples, a rule set can be entered in a tabular (or“spreadsheet”) format, as shown in FIG. 3, with rows and columns thatintersect in cells. Trigger columns 202, 204, 206, 208 in table 200correspond to criteria for available input data values, and rows 210 a-hcorrespond to rule cases, i.e., sets of criteria that relate to theavailable input data values. A cell at the intersection of a triggercolumn and the applicable rule case row 210 n contains a criterion forthat trigger column and rule case. A rule case 210 n applies to a givenrecord, e.g., 102 in FIG. 1, if data values of the record 102, for eachtrigger column in which the rule case has criteria, meets the triggeringcriteria. If a rule case 210 n applies, output is generated based on oneor more output columns 212. As described above, in general, a rule casethat has all of its input relationships satisfied may be referred to as“triggered,” and the rule set is referred to as “fired.” Each outputcolumn 212 corresponds to a potential output variable, and the value inthe corresponding cell at the intersection of the column 212 and theapplicable rule case row 210 n determines the output, if any, for thatvariable. In some examples, the cell can contain a value that isassigned to the variable or it can contain an expression that isevaluated to generate the output value, as discussed below. In someexamples, there may be more than one output column, though only one isshown in FIG. 3.

There may be several different types of trigger columns, includingcolumns that correspond to a variable, columns that contain expressionsbut are calculated once and then treated like variables, and columnsthat only contain expressions. Columns that only contain expressions arein some respects simpler than those corresponding to or treated asvariables. Such trigger columns can contain, for example, one of thefollowing types of cell values for defining trigger column criteria:

-   -   An expression. The condition will be considered to be true if        the evaluation of the expression evaluates to a non-zero, or        non-NULL value.    -   The keyword “any,” or an empty string. The condition is always        true. Each empty cell in a trigger column is equivalent to one        explicitly containing the keyword “any.”    -   The keyword “else.” The condition is true if none of the cells        above the cell containing “else” is true, in rows where all        cells to the left are identical.    -   The keyword “same”. The condition is true if the cell above is        true.

Columns that correspond to a variable (column variables) can have twotypes of cells. One type of cell is an expression cell. Those cellsbehave exactly like cells in a column that contains only expressions,described above. However, the keyword “this” can be used in theexpression to refer to the column variable. The other type of cell is acomparison value. An example grammar for comparison values is asfollows:

 comparison_value ::= compound_value ( “or” compound value )* compound_value ::= simple_value ( “and” simple_value )*  simple_value::= [ “not” ] ( value_expression | simple_function | membership_expr ) value_expression ::= [ operator ] value_element  operator ::= “>” | “<”| “>=” | “<=” | “!=” | “=” | “equals”  value_element ::= constant |constant | variable | “(“expression “)”  simple_function ::= “is_null” |“is_blank” | “is_valid” | “is_defined” |  “is_bzero”  membership_expr::= “in” “[“ value_element ( ( “,” | “to” | “or” ) value_ element)* “]” where a “*” means a term is repeated zero or more times.

Any suitable programming language or syntax may be used. Examplesinclude C, Java, DML, or Prolog. The column variable is compared againstthe comparison value according to the operator, function, or membershipexpression. In the example of FIG. 3, the first two columns 202 and 204contain comparison values with the “>=” operator. Accordingly, thecriteria is met if the value for that column is greater than or equal tothe corresponding number. If there is no operator, as in the “Class ofSeat” column, then “equals” is assumed. A constant can be any legalconstant in whatever programming language or syntax is used in theunderlying system. An expression is any legal expression in the languagebeing used that returns a compatible datatype that will be comparedagainst the column variable. In some examples, expressions insidecomparison values are enclosed in parenthesis to avoid ambiguity.

In the example of FIG. 3, the first row 210 a has criteria in only onecolumn, 202, which indicates that if the total number of frequent fliermiles for a traveler is greater than 1,000,000, then that rule caseapplies regardless of what value any other columns may have. In thatcase, the “Boarding Group” output variable for that user is set to group1. Likewise, the second rule case 210 b indicates that any flier infirst class is in group 1. In some examples, the rules are evaluated inorder, so a traveler having over 1,000,000 miles and a first classticket will be in group 1, but only the first rule case 210 a will betriggered.

The rule cases 210 a-h (FIG. 3) can also be represented as individualsimple rules, each in their own table, as shown in FIG. 4. Rules 220 a-dcorresponds to rows 210 a-d of

FIG. 3, respectively, while rule 220 e has four rule cases correspondingto rows 210 e-h together. A user could create these individual rulesseparately, rather than generating the entire table shown in FIG. 3.Each rule case contains a value (at least implicitly) for every triggercolumn and a value for every output column (the value can be blank,i.e., effectively set to “any”). When multiple rules generate the sameoutput, the rules are ordered and they are considered in order until arule case in one rule triggers on the inputs and generates an output. Ifno rule case in a rule triggers, the next rule that produces the sameoutput is processed. If no cases in any rule trigger for an output, adefault value is used.

In some examples, a user interface of the editor tool can be used tographically identify cells that contain expressions. Accordingly, a usercan understand the difference between an expression that will beevaluated to true or false on its own and an expression that returns avalue that is compared against the column variable. When the user istyping, he can indicate that a particular cell is to be an expressioncell by, for example, typing an asterisk at the beginning

For columns that correspond to output variables, the cells can containone of the following:

-   -   A value. The value that will be assigned to the output variable    -   An expression. The value of the expression is assigned to the        output variable. If the expression evaluates to NULL then the        field gets the NULL value, unless the output field is        not-nullable. In which case, an error is generated.    -   The keyword “null”. If the output field is nullable, then the        field will be assigned NULL. Otherwise, an error is generated.    -   An empty string. If the output field has a default value, then        the default value is assigned. Otherwise, the cell is treated as        if it contains the keyword “null”.    -   The keyword “same”. The output field is assigned the same value        computed in the cell above.

In addition to expressions, users can be allowed to attach comments toany cell in the rule, which can be displayed in response to userinteraction (e.g., clicking or “hovering” a pointer).

In some implementations, a rule set, e.g., the rule set shown below inTable 1, can include multiple rule cases that generate multiple outputrecords for a single input record.

TABLE 1 Trigger: Automobile Option Trigger: Budget Output: Trim LevelHonda S2000 >=37000 S2000 CR Honda S2000 else S2000 Honda AccordCoupe >=29000 Accord Coupe EX-L V-6 Honda Accord Coupe >=26000 AccordCoupe EX-L Honda Civic Sedan >=24000 Accord Coupe EX Honda Element anyAccord Coupe . . . . . . . . .

The rule set above considers a family's automobile options in view ofthe family's budget, and outputs a trim level for the automobile. Insome examples of such a rule set (referred to as a “normalize ruleset”), at least one of the output values is identified as a key outputvalue, e.g., “S2000 CR.” When the rules that compute the key outputvalue “S2000 CR” are evaluated, the rule case (Automobile Option: HondaS2000 and Budget: >=37000) that triggered on the input data record togenerate the output value “S2000 CR” is noted. The rule set is thenevaluated again with the previously-triggered rule case (AutomobileOption: Honda S2000 and Budget: >=37000) disabled to see if any otherrule cases trigger and produce an output value. The process describedabove is repeated until no additional rule cases are triggered. Eachoutput value is stored as a separate output record. In some examples,rule cases are grouped, such that if one triggers, others in its groupare also disabled on the next iteration for the same input record.

In some examples, the transform corresponding to the normalize rule setcan use two stages of processing. First, an input record is read and acount is computed, e.g., by calling a “length” function. The countcorresponds to a number of output records that will be generated. Then,another function, i.e., “normalize” function, is called for each outputrecord. The normalize function receives a copy of the input record and acurrent index from the count produced by the length function andproduces output values into different output records. For example, ifthe input record had a family size of four (4) and a budget of $20,000,the transform generates three output records, one for each of the threesuggested cars (Accord Sedan, Civic, and Element).

In some implementations, the transform calculates all possible valuesfor the Automobile Option, using the “length” function so that thenumber of output records is known. Once the transform has calculated allpossible Automobile Output values, the transform can then call the“normalize” function as many times as there are output records, toassign values to each of the output records.

In some implementations, instead of the two stage processing describedabove, the transform can calculate all possible values for theAutomobile Option by calling the “normalize” function directly severaltimes until there are no more values to compute.

FIG. 5 is an example rule set 500 for generating multiple values 504 foran output variable 508. A user may be interested in knowing all of thereasons why a specific vehicle is considered invalid, not just the firstreason. In some examples, as shown in FIG. 6, a first step is for theuser to specify, using an output tab 600 in a user interface of theeditor, that the rule set 500 produces multiple output values 504.

As such, the user indicates that the output variable 508 “NameValidation Message” is an accumulator variable for receiving a series ofvalues 504. The Output Type 604 corresponding to the output variable 508changes to indicate “accumulator” 608.

In some examples, scalar values corresponding to the output variable 508can be “accumulated” for use with “score-card” style rule sets. A scorecard style rule set refers to a type of business rule where a userindicates a positive or negative score to be included into a rulesvalue. Accordingly, rather than storing values corresponding to theoutput variable 508 as an output vector, a sum of the values that areaccumulated corresponding to the output variable 508 is stored as ascalar value.

In some examples, the accumulator output variable 508 maps to a variablelength vector or array for each record in the output dataset. As such,if the output variable 508 is treated as an array, the user can specifya size for the output variable 508. The user can specify a length of theoutput variable 508 by changing the Max Count 612 parameter.Accordingly, field 614 indicates that the output variable 508 is treatedas an array for receiving a certain number (e.g., 20) of values. In someexamples, in the absence of a user-specified size, by default, theoutput variable 508 can receive unlimited number of values. As such, theMax Count 612 parameter indicates, for example, “unlimited.” In someexamples, to help distinguish accumulator type output variables fromwrite-once type output variables, the editor can prohibit users fromediting the Max Count 612 parameter for a write-once variable. In someexamples, if the user switches from an accumulator output variable to awrite-once output variable, the editor can clear the Max Count 612parameter.

FIG. 7 is an example rule tab 700 showing a fire many rule set, e.g.,“Validate Person.” Accumulator output variables 708 are visuallydistinguished from write-once outputs 712 by the annotation “Write-OnceOutputs” or “Accumulator Outputs.” In addition, various otherannotations are possible. For example, a type of rule set, i.e., a“Fire-Many Rule” (rule which produce accumulator outputs), or a“Fire-Once Rule” (rule which produces a scalar output) may be indicatedat the top 704 of the rule tab 700, or a vertical annotation 712 on oneside indicates “Fire Once” or “Fire Many.” In some examples, differenticons may be used for fire once and fire many rules. In some examples,all of the rule cases that fired may be highlighted for inspection bythe user.

FIG. 8 is an example results tab 800 showing contents of the accumulatoroutput variable 801, “Validation Message.” As shown, the output variable801 can assume a first series of values 813 for each record, and atleast one of the values of the first series of values 813 (e.g., thevalue corresponding to “TANGELA SCHEPP”) can assume a second series ofvalues 816 that are displayed as a collection of comma separated values.In some examples, a user can “hover” a mouse pointer over an accumulatoroutput value to uncover a tool tip showing a list of accumulated values.In some examples, when performing a test including, for example,benchmark data, an output can be marked as being different if a vectorin the benchmark data differs from the vector in the output in any way.For example, differences can include, the benchmark vector having adifferent number of items than the output vector, the benchmark vectorhaving items in a different order than the output vector, and individualitems within each of the vectors being different.

In operation, an accumulator output variable is used for receivingmultiple output values produced by a Fire-Many rule set as describedbelow. For example, consider the following rule set shown in Table 2:

TABLE 2 Trigger: Budget Trigger: Family Size Output: AutomobileOption >=35000 <=2 Honda S2000 >=22000 <=2 Honda Accord Coupe >=20000<=4 Honda Accord Sedan >=15000 <=4 Honda Civic Sedan >=20000 <=6 HondaElement >=28000 <=7 Honda Odyssey >=50000 <=4 Acura RL

The rule set above considers, for example, a family size of 4 and abudget of $20,000, to suggest three cars (Accord Sedan, Civic andElement). Accordingly, in this case, an output variable “AutomobileOption” in an output dataset is deemed to be able to receive multiplevalues. Each rule case in the rule set is evaluated and any time a rulecase triggers, a value from the rule set above is added to theaccumulator output variable.

The triggers in the rule set above can be any scalar variables(non-vectors) including input values, lookups and other output values.In some examples, an output variable can compute another outputvariable. In some examples, only a non-vector output can be used as atrigger. In some examples, it is possible to indirectly use oneaccumulator output variable to compute another accumulator outputvariable by using the aggregation functions. For example, consider thefollowing rule set shown in Table 3:

TABLE 3 Trigger Output: Family Members is_alive Self is_married and notis_separated Spouse has_baby Baby has_teenage_girl Daughterhas_teenage_boy Son

The rule set above computes an accumulator output variable called“Family Members.” Now, consider the following rule set shown in Table 4:

TABLE 4 Output: Family Size count_of(Family Members)

The rule set in Table 4 computes a scalar (non-vector) called “FamilySize,” using an aggregation function. Accordingly, first, an outputvector is computed that includes a list of all our family members. Then,a count function counts the number of people in the list. The count isthen used as input to compute a list of automobiles.

FIG. 9 illustrates an example implementation using scalars and vectorsto compute values for other scalar and vectors using an accumulatoroutput variable. As shown, S1, S2 and S3 represent scalar variables. V1and V2 represent vector variables. S1 is used to compute S2; then S2 isused to compute four different values of V1. Then all four values of V1are used to compute S3 (e.g., through the use of an aggregationfunction). Finally, S3 is used to compute three values of V2.

In some implementations, the editor can produce validation errors whenthe user attempts to carry out any of the following example actions:Marking an output as an accumulator when the type of the field in any ofthe datasets is anything other than a variable length vector; mark anoutput as “write-once” when the type of the field in any of the datasetsis a vector; provide a default value for an accumulator (in animplementation in which only write-once outputs can havedefault-values), use an accumulator output as a comparison triggercolumn; mix accumulator and write-once outputs within a single rule; andinput a value other than unlimited or a positive number in the Max Countparameter of an accumulator output variable.

In some examples, input records can include vectors. FIG. 10A is anexample format of an input record 950 that includes at least two vectorsrecords, i.e., driver record vector 952, and vehicle record vector 954.FIG. 10B shows example data 956 for the input record 950.

An aggregation function can be included in a rule set to convert therecord vectors 952, 954 into scalars. For example, the rule set caninclude a specification “Age of youngest driver.” In someimplementations, the specification is expressed as “minimum (DriverAge),” or a data manipulation language (DML) function such as“do_minimum (in0.drivers, ‘age’)” can be used. In response to the ruleset, a scalar value is produced, e.g., 21 (from Pebbles' record in FIG.10B) In some examples, in operation, a function can loop through all therecords in the driver record vector 952 to find the minimum value fordriver age.

Considering another example, the specification in a rule set can be“Number of points plus one for the youngest male driver.” Thespecification can be expressed as “minimum (Driver Age, Driver Sex=Male,Driver Points+1).” In response to this rule set, a scalar value isproduced, e.g., 14 (from BamBam's record). In some implementations, thescalar values can be assigned to intermediate or output variables, whichare scalars.

In some examples, a rule can be written for each element in a recordvector. For example, consider the following rule set shown in Table 5:

TABLE 5 Vehicle has Vehicle has Value Adjustment Air Bag (trigger) SeatBelts (trigger) (output) no No 0 no Yes 100 yes No 150 yes Yes 300

The specification in the rule set of Table 5 is “For each car, computethe adjustment to the car's value, which is 100 if the car has seatbelts, 150 if the car has air bags, and 300 if the car has both.” Asshown, the output variable “Value Adjustment” is a vector variable. Inresponse to the above rule, a vector, e.g., [0, 300, 100] is produced.In some examples, in operation, the rule set is executed multiple times,once for every record in the vehicle record vector 954.

In some examples, the rule set can also reference scalar values, orother vectors as long as the vectors are of the same length. Forexample, consider the following rule set shown in Table 6:

TABLE 6 Vehicle Age (trigger) Adjusted Value (output) >2 Vehicle Value +Value Adjustment + Geographic Adjustment − 50 else Vehicle Value + ValueAdjustment + Geographic Adjustment

The specification in the rule set of Table 6 is “For each car, computethe adjusted value, which is the sum of the car's value, its valueadjustment and the geographic risk. Subtract 50 if the car is older than2 years.” In this rule, “Adjusted Value” is a vector variable.Accordingly, to avoid a runtime error due to unequal vector lengths, thevector variable “Value Adjustment” is of same length as the vehiclerecord vector 954. In response to this rule set, a vector, e.g., [1030,1880, 1330] is produced.

In some examples, when XML records are complex, a single input recordcan be used to represent many logical records by relating them with keyrelationships. For example, each vehicle sub-record in the vehiclerecord vector 954 can include a foreign key, e.g., “driver,” to relateto a matching key in the driver record vector 952, e.g., “name.” In thismanner, the record vectors 952, 954 can be implemented as look-up file,or an internal reference table. For example, an internal reference tableassociated with the vehicle record vector 954 can be as follows:

-   -   Primary Driver Name (primary key)    -   Primary Driver Age    -   Primary Driver Sex    -   Primary Driver Points

Accordingly, internal reference tables, can be created for each inputrecord by treating the sub-records in the record vectors as records inthe internal reference tables. In operation, consider for example, arule set shown in Table 7:

TABLE 7 output: Age of Policy Driver Primary Driver Age (Policy Driver)

The specification in the rule set of Table 7 is “Compute the Age of thePolicy Driver, which is the Primary Driver Age found by using the valueof Policy Driver as the key for the associated internal referencetable.” The specification returns the value in the Primary Driver Agecolumn, which is then assigned to the output variable, “Age of PolicyDriver.” “Age of Policy Driver” is a scalar value. In another example,consider the rule set shown in Table 8 below:

TABLE 8 Age at Purchase (output) Primary Driver Age-Vehicle Age

The specification in the rule set of Table 8 is “Compute the Age atPurchase, which is the difference between the vehicle's age and the ageof the vehicle's primary driver.” For purposes of illustration, assumethat the look-up key is assigned “Vehicle Primary Driver” by default.The output variable “Age at Purchase” is a vector variable. Accordingly,in response to the above rule, [31, 19, 27] is produced.

In some examples, the look-up key “Vehicle Primary Driver” can bespecified explicitly in parentheses as follows “Primary Driver Age(Vehicle Primary Driver)−Vehicle Age.

In some examples, the internal reference tables can be used inaggregation functions. For example, a specification can be “Compute theaverage over all the vehicles of the age of their primary drivers.” Thisspecification can be implemented by the function, for example, “average(Primary Driver Age (Vehicle Primary Driver)).” In response to thisfunction, a scalar value is produced, e.g., 29.67.

In some implementations, a user can visualize the computations steps inthe above rule sets. For example, in testing mode, it may be useful fora user to be able to examine values of interest, e.g., intermediatevalues of input and output variables (both scalar and vector variables).Various techniques for visualizing the steps known in the art can beused. For example, a pop-up table having a row for each element in theinput record vector 952, 954 can be implemented to summarize theintermediate values indicating what items have been filtered out, orcomputed.

The techniques described above can be implemented using software forexecution on a computer. For instance, the software forms procedures inone or more computer programs that execute on one or more programmed orprogrammable computer systems (which may be of various architecturessuch as distributed, client/server, or grid) each including at least oneprocessor, at least one data storage system (including volatile andnon-volatile memory and/or storage elements), at least one input deviceor port, and at least one output device or port. The software may formone or more modules of a larger program, for example, that providesother services related to the design and configuration of computationgraphs. The nodes and elements of the graph can be implemented as datastructures stored in a computer readable medium or other organized dataconforming to a data model stored in a data repository.

The software may be provided on a storage medium, such as a CD-ROM,readable by a general or special purpose programmable computer ordelivered (encoded in a propagated signal) over a communication mediumof a network to the computer where it is executed. All of the functionsmay be performed on a special purpose computer, or using special-purposehardware, such as coprocessors. The software may be implemented in adistributed manner in which different parts of the computation specifiedby the software are performed by different computers. Each such computerprogram is preferably stored on or downloaded to a storage media ordevice (e.g., solid state memory or media, or magnetic or optical media)readable by a general or special purpose programmable computer, forconfiguring and operating the computer when the storage media or deviceis read by the computer system to perform the procedures describedherein. The inventive system may also be considered to be implemented asa computer-readable storage medium, configured with a computer program,where the storage medium so configured causes a computer system tooperate in a specific and predefined manner to perform the functionsdescribed herein.

A number of embodiments of the invention have been described.Nevertheless, it will be understood that various modifications may bemade without departing from the spirit and scope of the invention. Forexample, some of the steps described above may be order independent, andthus can be performed in an order different from that described.

It is to be understood that the foregoing description is intended toillustrate and not to limit the scope of the invention, which is definedby the scope of the appended claims. For example, a number of thefunction steps described above may be performed in a different orderwithout substantially affecting overall processing. Other embodimentsare within the scope of the following claims.

What is claimed is:
 1. A method, including: receiving a rule having atleast one rule case for producing an output value based on one or moreinput values, generating a transform for receiving data from an inputdataset and transforming the data based on the rule including producinga first series of values for at least one output variable in an outputdataset, at least one value in the first series of values including asecond series of values, and providing an output field corresponding tothe at least one output variable in the output dataset for storing thesecond series of values.
 2. The method of claim 1 in which the transformis included in a component of a graph-based application represented by agraph, with vertices in the graph representing components, and directedlinks between vertices in the graph represent flows of data betweencomponents.
 3. The method of claim 2 in which a first graph componentincluding the transform provides a flow of data to the transform fromthe input dataset.
 4. The method of claim 3 in which the first graphcomponent is an executable computation component, and the graph includesa second graph component that is a data storage component representingthe input dataset.
 5. The method of claim 1 in which producing a firstseries of values for at least one variable in an output dataset includesproducing rows for an output table, each row defining a record havingvalues for a set of variables including the output variable.
 6. Themethod of claim 1 in which providing an output field for storing thesecond series of values includes providing an array for storing apredetermined number of the second series of values, the predeterminednumber being a default number that is modifiable to a user-specifiednumber.
 7. The method of claim 1 in which the output field includes acell in a table.
 8. The method of claim 1 in which receiving the ruleincludes receiving at least a row of a rule table, the row correspondingto a rule case, and having an output including one or more or acombination of the input values, a predetermined value, or a valuecomputed from one or more of the input values.
 9. The method of claim 8in which the rule case includes one or more of: having an input valueequal to a threshold, having an input value above a threshold, having aninput value below a threshold, having an input value belonging to a setof values, having an input value matching a pattern of values, having arelationship to another input value, having a relationship to an outputvalue of another set of rules, or having a relationship to a value in amemory.
 10. The method of claim 1 in which the input dataset includesrecords having values for scalar variables and vector variables.
 11. Themethod of claim 10 in which at least one of the records includes anarray for storing a predetermined number of records, the predeterminednumber being a default number that is modifiable to a user-specifiednumber
 12. The method of claim 10 in which at least one of the recordsincludes an internal reference table to define key relationships tosub-records in the at least one of the records.
 13. The method of claim12 also including, in response to a rule, producing the second series ofvalues for the output variable in the output dataset based on the keyrelationships in the internal reference table.
 14. The method of claim 1also including, in response to a rule case in a rule, triggering therule case to produce a value for the output variable in the outputdataset.
 15. The method of claim 14 in which triggering the rule caseincludes triggering the rule case based on a scalar value in the inputdataset satisfying the at least one rule case in the rule.
 16. Themethod of claim 14 in which triggering the rule case includes triggeringthe rule case based on each value in a vector in the input datasetsatisfying the at least one rule case in the rule.
 17. The method ofclaim 14 in which triggering the rule case includes triggering the rulecase based on an output of an aggregate function applied to a vector inthe input dataset satisfying the at least one rule case in the rule. 18.The method of claim 1 in which generating the transform includesconverting each of a plurality of rule cases in the rule to a logicalexpression to form a plurality of logical expressions, and compiling theplurality of logical expressions into computer-executable code.
 19. Themethod of claim 18 in which compiling the plurality of logicalexpressions includes one or more of combining expressions, optimizingindividual expressions, and optimizing groups of expressions.
 20. Anon-transitory computer-readable medium, storing a computer program forupdating a component in a graph-based computation having data processingcomponents connected by linking elements representing data flows, thecomputer program including instructions for causing a computer to:receive a rule having at least one rule case for producing an outputvalue based on one or more input values, generate a transform forreceiving data from an input dataset and transforming the data based onthe rule including producing a first series of values for at least oneoutput variable in an output dataset, at least one value in the firstseries of values including a second series of values, and provide anoutput field corresponding to the at least one output variable in theoutput dataset for storing the second series of values.